<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<meta property="wb:webmaster" content="7ae117dc1d8992dc" />
	<link href="/wenzi/css/common.css" rel="stylesheet" />
	<script src="/wenzi/js/zepto-1.1.6.js"></script>
	<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<title>啪啪蚊子奖励</title>
	<style>
		html, body {
			margin: 0;
			padding: 0;
		}

		html, body, .gift-wrapper {
			min-height: 100%;
		}

		body {
			background: url('/wenzi/img/bg.jpg') no-repeat;
			background-size: cover;
			text-align: center;
		}

		.gift-wrapper > img {
			margin-bottom: 1rem;
			margin-top: 1rem;
			max-width: 686px;
			width: 91.5%;
		}

		.gift-wrapper a > img {
			max-width: 290px;
			width: 38.8%;
		}
	</style>
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?19f39b206aedf768b42fbc69e4e4f721";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
</head>
<body>
	<div class="gift-wrapper">
		<header>
			<img src="/wenzi/img/gift_title.png" />
		</header>
		<img src="/wenzi/img/gift.png" />
		<?php if($device == 'wechat'):?>
		<a href="http://mp.weixin.qq.com/s?__biz=MzAxMDc3NDM1Mg==&mid=502325165&idx=1&sn=6714a6393b60f134f2c4ed4c9f4fa1c6&scene=1&srcid=0708biggLktgxE7mE6UX2FS2#wechat_redirect">
			<img src="/wenzi/img/btn_followgift.png" />
		</a>
		<?php else:?>
		<a href="http://weibo.com/5928035261/DEl67CJPz?from=page_1006065928035261_profile&wvr=6&mod=weibotime">
			<img src="/wenzi/img/btn_followgift.png" />
		</a>
		<?php endif;?>
	</div>
</body>
<?php if($device == 'wechat'):?>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });
        wx.ready(function () {
        	wx.onMenuShareTimeline({
        	    title: '<?php echo $share_content?>', // 分享标题
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 3},
        				type: "post",
        				success: function(res){
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});

        	wx.onMenuShareAppMessage({
        		title: '<?php echo $share_desc?>', // 分享标题
        	    desc: '<?php echo $share_content?>', // 分享描述
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    	$.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 3},
        				type: "post",
        				success: function(res){
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});
        });
    })
	</script>
	<?php endif;?>
</html>